<template>
    <view class="membertag">
        <radio-group @change="radioChange($event, index)">
            <label class="radio" v-for="radioitem in data">
                <radio
                    style="transform: scale(0.7)"
                    color="#007e41"
                    :checked="radioitem.check"
                    :value="radioitem.name" />{{ radioitem.name }}
            </label>
        </radio-group>
    </view>
</template>

<script>
export default {
    props: {
        data: {
            // 数据
            type: Array,
        },
        index: {
            type: Number,
            default: 0,
        },
    },
    data() {
        return {}
    },
    methods: {
        radioChange(e, index) {
            let value = e.detail.value
            this.$emit("radioChange", index, value)
        },
    },
}
</script>

<style lang="scss">
.membertag {
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: flex-start;

    text {
        padding: 2rpx 5rpx;
        display: flex;
        justify-content: center;
        align-items: center;
        color: $app-color-main;
        border: 1rpx solid $app-color-main;
        border-radius: 4rpx;
        margin-left: 10rpx;
    }
}
</style>
